package cn.exrick.xboot.common.timeTask.approval;

import cn.exrick.xboot.common.constant.CommonConstant;
import cn.exrick.xboot.common.timeTask.test.myRunnable;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class StartApprovalThread {

    public  static void  startThread(){
        ApprovalTimeOut approvalTimeOut=new ApprovalTimeOut();
        ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
        //service.scheduleAtFixedRate(runnable,0,1, TimeUnit.SECONDS);
        //service.schedule(approvalTimeOut, CommonConstant.APPROVAL_END_TIME, TimeUnit.MINUTES);//分
        service.schedule(approvalTimeOut,CommonConstant.APPROVAL_END_TIME, TimeUnit.SECONDS);//秒
    }
}
